home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
PlainText
/
MakeExtern
< prev
next >
Wrap
Text File
|
1990-10-01
|
611b
|
24 lines
# MakeExtern makes a C include file declaring external globals.
# It's input is the root declaration file for those globals.
duplicate -y "{1}" "{2}"
target "{2}"
find •
find /'Globals are declared here.'/
clear ¡0:1
# remove size from array declarations
replace -c ∞ /∂[[a-zA-Z_0-9]+∂]/ ∂[∂]
find •
# remove trailing whitespace so that the next command can work
replace -c ∞ /[ ∂t]+∂n/ ∂n
# remove newlines after commas
find •
replace -c ∞ /,∂n/ ','
find •
# clear all curly bracket pairs
replace -c ∞ /∂{≈∂}/ ''
find •
replace -c ∞ /=[¬,;]+/ ''
find •
replace -c ∞ /•([a-z_A-Z])®1/ 'extern ®1'
close -y "{2}"